<template>
    <view class="main">
        <img :src="codeImg" alt="" style="width: 100%;margin: 0 auto;">
    </view>
</template>

<script>
    import {
        getWxaCode
    } from '@/service/getOpenid.js'
    import {
        getTime,
        getStorage
    } from '@/utils/utils.js'
    export default {
        data() {
            return {
                title: 'code',
                codeImg : ''
            }
        },
        onLoad(param) {
            this.getWxaCode();
        },
        methods: {
            // 获取分享码
            async getWxaCode() {
                let {
                    data
                } = await getWxaCode({
                    'timestamp': getTime(),
                    'openId': getStorage('openId'),
                });
                this.codeImg = data.codePath;
            },
        }
    }
</script>

<style>
</style>
